package com.xxxy.dongyexuan.mapper;

import com.xxxy.dongyexuan.po.Emp;
import com.xxxy.dongyexuan.po.Technology;
import com.xxxy.dongyexuan.po.Work;
import org.apache.ibatis.annotations.*;
import org.mybatis.spring.annotation.MapperScan;

import java.util.List;

@MapperScan("com.xxxy.dongyexuan.demobeautyhaird.mapper")
public interface ITechnologyMapper {
    @Select("select count(*) from technology where pid = #{pid}")
    public int getcount(@Param("pid") int pid);

    @Select("SELECT * FROM technology WHERE tid = #{tid}")
    public Technology findByIdmeifa(@Param("tid") int tid);
    @Select("SELECT * FROM technology WHERE tid = #{tid}")
    public Technology findByIdmeirong(@Param("tid") int tid);

    @Select("SELECT * FROM technology")
    public List<Technology> findAll();

    @Select("SELECT * FROM technology WHERE pid = 1")
    public List<Technology> findTechnologyByMeIRong();
    @Select("SELECT * FROM technology WHERE pid = 2")
    public List<Technology> findTechnologyByMeIFa();

    @Insert("INSERT technology VALUES (#{tid},#{pid},#{tname})")
    public int savemeifa(Technology technology);

    @Update("UPDATE technology SET pid = #{pid},tname=#{tname} WHERE tid = #{tid}")
    public int mergemeifa(Technology technology);

    @Delete("DELETE FROM technology WHERE tid = #{tid}")
    public int deletemeifa(@Param("tid") int tid);
    @Insert("INSERT technology VALUES (#{tid},#{pid},#{tname})")
    public int savemeirong(Technology technology);

    @Update("UPDATE technology SET pid = #{pid},tname=#{tname} WHERE tid = #{tid}")
    public int mergemeirong(Technology technology);

    @Delete("DELETE FROM technology WHERE tid = #{tid}")
    public int deletemeirong(@Param("tid") int tid);
    @Select("SELECT * FROM technology WHERE pid = 1 LIMIT #{from}, #{pagesize}")
    public List<Technology> findByMeiRongPage(@Param("from") int from, @Param("pagesize") int pagesize);
    @Select("SELECT * FROM technology WHERE pid = 2 LIMIT #{from}, #{pagesize}")
    public List<Technology> findByMeiFaPage(@Param("from") int from, @Param("pagesize") int pagesize);
}
